package com.rc.pojo.po;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.rc.common.model.BaseConEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 *  实体类。
 *
 * @author 27806
 * @since 2024-06-15
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "order", schema = "rc")
public class Order implements BaseConEntity,Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 订单id
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 订单的状态，1、未付款 2、已付款,未发货 3、已发货,未确认 4、确认收货，交易成功 5、交易取消，订单关闭 6、交易结束，已评价
     */
    private Integer status;

    private Integer type;

    /**
     * sku商品id
     */
    private Long itemId;

    /**
     * 总金额，单位为分
     */
    private BigDecimal totalFee;

    /**
     * 购买数量
     */
    private Integer num;

    /**
     * 商品标题
     */
    private String title;

    private String description;

    private BigDecimal price;

    private String cover;

    private LocalDateTime payTime;


    private LocalDateTime endTime;

    private LocalDateTime consignTime;

    private LocalDateTime commentTime;

    @Column(onInsertValue = "now()",onUpdateValue = "now()")
    private LocalDateTime updateTime;

    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    @Column(tenantId = true)
    private Long farmId;

    private Long conId;
}
